import { request } from '@/utils/request.js'

/**
 * 周期结算 API JS
 */

export default {

  /**
   * 获取周期结算分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'financial/periodic/index',
      method: 'get',
      params
    })
  },

  /**
   * 添加周期结算
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'financial/periodic/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新周期结算数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'financial/periodic/update/' + id,
      method: 'put',
      data
    })
  },

  /**
   * 读取周期结算
   * @returns
   */
  read (id) {
    return request({
      url: 'financial/periodic/read/' + id,
      method: 'get',
      data
    })
  },

  /**
   * 将周期结算删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'financial/periodic/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 获取财务台账数据
   * @returns
   */
  getDeptList (params = {}) {
    return request({
      url: 'financial/payOrder/deptList',
      method: 'get',
      params
    })
  },
}